package com.flashcash.kotlin.data

import android.support.annotation.StringRes
import com.flashcash.solu.R
import java.io.Serializable


/**
 * @作者:My
 * @创建日期: 2017/7/12 14:34
 * @描述:${TODO}
 *
 * @更新者:${Author}$
 * @更新时间:${Date}$
 * @更新描述:${TODO}
 */
enum class RequestLevel {
    IMMEDIATELY, LATEST, WAITNEXT
}

enum class LockViewMode {
    SETTING, LOGGING
}

enum class PolicyType {
    PRIVACY, LOAN_AGREEMENT
}

enum class LoanStatus() {
    FINAL_REVIEW("FINAL_REVIEW", R.string.final_review), // 终审
    APPROVED("APPROVED", R.string.approved), // 审批通过
    CURRENT("CURRENT", R.string.current), // 还款期
    CLOSED("CLOSED", R.string.closed), // 系统关闭
    BAD_DEBIT("BAD_DEBIT", R.string.bad_debit), // 坏账
    FIRST_REVIEW("FIRST_REVIEW", R.string.first_review), // 初审
    GRACE_PERIOD("GRACE_PERIOD", R.string.grace_period), // 宽限期
    ISSUE_FAILED("ISSUE_FAILED", R.string.issue_failed), // 放款失败
    ISSUING("ISSUING", R.string.issuing), // 放款中
    OVERDUE("OVERDUE", R.string.overdue), // 逾期
    PAID_OFF("PAID_OFF", R.string.paid_off), //已还清
    PRE_REVIEW("PRE_REVIEW", R.string.pre_review), // 预审
    READY_TO_ISSUE("READY_TO_ISSUE", R.string.ready_to_issue), // 准备放款
    REJECTED("REJECTED", R.string.rejected), // 已拒绝
    SECOND_REVIEW("SECOND_REVIEW", R.string.second_review), // 复审
    SUBMITTED("SUBMITTED", R.string.submitted), // 已提交
    SUPPLEMENT("SUPPLEMENT", R.string.supplement), // 补件
    WITHDRAWN("WITHDRAWN", R.string.withdrawn), // 用户主动取消
    IN_REVIEW("IN_REVIEW", R.string.in_review); // 审批中

    private lateinit var status: String
    private var stringRes: Int = 0

    constructor(status: String, @StringRes stringRes: Int) {
        this.status = status
        this.stringRes = stringRes
    }

    companion object {
        @StringRes
        fun getStringRes(status: String): Int {
            for (loanStatus in LoanStatus.values()) {
                if (loanStatus.status == status) {
                    return loanStatus.stringRes
                }
            }

            return -1
        }
    }
}

enum class FileType : Serializable {
    KTP_PHOTO, // 身份证正面
    KTP_PHOTO_2,  // 身份证反面
    EMPLOYMENT_PHOTO,  // 工作证
    CONTRACT_VIDEO // 录像
}

class SysDict {
    enum class Type {
        EDUCATION // 教育
    }
}